from microbit import *
# Write your code here :-)
display.show(Image.RABBIT)
def keyboard(btn):
    uart.write(btn+"\n")

while(True):
    if button_a.is_pressed():
        keyboard("A")
    if button_b.is_pressed():
        keyboard("D")
    if button_a.is_pressed() and button_b.is_pressed():
        keyboard("C")
    if accelerometer.is_gesture("left"):
        keyboard("A")
    if accelerometer.is_gesture("right"):
        keyboard("D")
    if accelerometer.is_gesture("up"):
        keyboard("K")
    if accelerometer.is_gesture("down"):
        keyboard("J")

    sleep(50)

